﻿@model Project_2._2.ViewModels.AdminPerson_Create_ViewModels
@{
    ViewBag.Title = "Tạo Tài Khoản Mới";
    Layout = "~/Views/Shared/_AdminLayoutPage.cshtml";
}

@{
    List<SelectListItem> list = new List<SelectListItem>();
    list.Add(new SelectListItem { Text = "Nam", Value = "Nam", Selected = true });
    list.Add(new SelectListItem { Text = "Nữ", Value = "Nữ" });
}

@*goi su kien form click de kt validate*@
<script>
    jQuery(document).ready(function () {
        // binds form submission and fields to the validation engine
        jQuery("#form").validationEngine();
    });

</script>


<div class="grid_12">
	<div class="block-border">
	    <div class="block-header">Tạo Tài Khoản Mới
		    @Html.ActionLink("Trở về Danh Sách", "Default", "AdminPerson", null, new { @class = "button" })
	    </div>
		<div class="block-content">

            @using (Html.BeginForm("Create", "AdminPerson", FormMethod.Post, new { id = "form"}))
            {       
                @Html.ValidationSummary(true) 
                @Html.AntiForgeryToken();
               
                <table  style="padding:10px 0 15px 150px ; line-height:35px">
                    <tr>
                        <td class="align-right" style="text-align:right">@Html.LabelFor(m => m.UserName)&nbsp;<span style="color:red">*</span></td>
                        <td> 
                            @Html.TextBoxFor(m => m.UserName, new { @class = "Textbox validate[required,minSize[6],maxSize[50]]" })
                            @Html.ValidationMessageFor(m => m.UserName)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.Pass)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.PasswordFor(m => m.Pass, new { @class = "Textbox validate[required,minSize[6],maxSize[12]]" })
                            @Html.ValidationMessageFor(m => m.Pass)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.ConPass)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.PasswordFor(m => m.ConPass, new { @class = "Textbox validate[required,equals[Pass]]" })
                            @Html.ValidationMessageFor(m => m.ConPass)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.RoleId)</td>
                        <td>  
                            @{
                List<SelectListItem> RoleList = new List<SelectListItem>();
                RoleList.Add(new SelectListItem { Text = "--  Chọn  --", Value = "", Selected = true });
                RoleList.Add(new SelectListItem { Text = "Quản Trị", Value = "1" });
                RoleList.Add(new SelectListItem { Text = "Người  Dùng", Value = "2" });
                            }
                            @Html.DropDownListFor(m => m.RoleId, RoleList, new { @class = "select validate[required]" })  
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.Name)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.TextBoxFor(m => m.Name, new { @class = "Textbox validate[required,minSize[6],maxSize[200]]" })
                            @Html.ValidationMessageFor(m => m.Name)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.DOB)&nbsp;<span style="color:red">*</span></td>
                        <td>
                            @Html.TextBoxFor(m => m.DOB, new { @class = "Textbox validate[required,custom[date]]" })
                            @Html.ValidationMessageFor(m => m.DOB)
                        </td>
                        
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.GioiTinh)</td>
                        <td>  
                                @Html.DropDownListFor(m => m.GioiTinh, list, new { @class = "select" })  
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.Email)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.TextBoxFor(m => m.Email, new { @class = "Textbox validate[required,custom[email],maxSize[100]]" })
                            @Html.ValidationMessageFor(m => m.Email)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.DienThoai)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.TextBoxFor(m => m.DienThoai, new { @class = "Textbox validate[required,custom[phone]]" })
                            @Html.ValidationMessageFor(m => m.DienThoai)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.DiaChi)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.TextAreaFor(m => m.DiaChi, new { @class = "TextArea validate[required,maxSize[500]]" })
                            @Html.ValidationMessageFor(m => m.DiaChi)
                        </td>
                    </tr>
                    <tr>
                        <td class="align-right">@Html.LabelFor(m => m.isDelete)&nbsp;<span style="color:red">*</span></td>
                        <td>  
                            @Html.CheckBoxFor(m => m.isDelete)<span>&nbsp;Đang xóa</span>
                            @Html.ValidationMessageFor(m => m.isDelete)
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="submit" class="MyButton" value="Tạo Tài Khoản" />
                        </td>
                    </tr>

                </table>
            }

        </div>
     </div>
</div>

@*//*@
<script src="~/Script/DateTimePicker_Js/jquery.datetimepicker.js"></script>
<link href="~/Content/DateTimePicker_Css/jquery.datetimepicker.css" rel="stylesheet" />
<script>
    jQuery('#DOB').datetimepicker({
        lang: 'vi',
        i18n: {
            de: {
                months: [
                    'Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4',
                    'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8',
                    'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12',
                ],
                dayOfWeek: [
                    "CN", "T2", "T3", "T4",
                    "T5", "T6", "T7",
                ]
            }
        },
        timepicker: false,
        format: 'd-m-Y'
    });

    document.getElementById("acc").setAttribute("class", "activee")
</script>